package com.hundsun.cprs.yyt.service.system.enums;

import java.util.HashMap;
import java.util.Map;

public enum EnumBussinessParam {
	
	MANAGEMENT_RATE("management_rate","挂售综合管理费比例"),
	COMMISSION_RATE("commission_rate","挂售交易手续费比例"),
	ENTRUST_SELL_EXPIRE_DAYS("entrust_sell_expire_days","挂售单挂售过期天数"),
	USER_SELL_MONEY_LIMIT("user_sell_money_limit","用户每日挂售金额上限，单位元"),
	USER_SELL_AMOUNT_LIMIT("user_sell_amount_limit","用户每日挂单数量上限"),
	TIME_INTERVAL_BETWEEN_SELL("time_interval_between_sell","两次委售时间间隔，单位分钟"),
	NEW_USER_RULE_LIMIT("new_user_rule_limit","新人判断规则(委售成功次数限制)"),
	USER_QOUTE_USE_LIMIT("user_qoute_use_limit","用户每日消费配额上限"),
	TRADING_TIME_PERIOD_CONTROL("trading_time_period_control","交易时间段控制"),
	MATCH_NEW_WEIGHT("match_new_weight","新老会员委售单售出权重比,默认为(1:1)"),
	MATCH_BUY_NEWUSER_RATE("match_buy_newuser_rate","匹配新用户商品数占比,默认为50,单位(%)"),
	DEFAULT_QUOTA_REWARD_RATE("default_quota_reward_rate","默认配额奖励比例"),
	DEFAULT_INTEGRAL_REWARD_RATE("default_integral_reward_rate","默认积分奖励比例"),
	QUOTE_EXCHANGE_POINT_RATE("quote_exchange_point_rate","配额兑换积分比例,默认：1:1"),
	LIMIT_CONTINUE_ENTRUST_SELL_GOODS("limit_continue_entrust_sell_goods","限制连续委卖的商品,多个以逗号相隔"),
	REAL_NAME_ADD_INTEGRAL("real_name_add_integral","实名完成后赠送积分数量"),
	REAL_NAME_REFER_ADD_INTEGRAL("real_name_refer_add_integral","实名完成后其推荐人赠送积分数量"),
	LIMIT_MORE_REFER_NUM("limit_more_refer_num","系统限制会员推荐人数最多多少人"),
	GOLDEN_FLOWER_GOODS("golden_flower_goods","指定金莱花商品,多个以逗号相隔")
	;
	/** 状态值 */
	private String code;
	/** 状态值说明 */
	private String value;

	private EnumBussinessParam(String code, String value) {
		this.code = code;
		this.value = value;
	}

	/**
	 * 全局索引池
	 */
	private static Map<String, EnumBussinessParam> pool = new HashMap<String, EnumBussinessParam>();
	static {
		for (EnumBussinessParam et : EnumBussinessParam.values()) {
			pool.put(et.code + "", et);
		}
	}

	/**
	 * 根据内容索引
	 * 
	 * @param code
	 * @return
	 */
	public static EnumBussinessParam indexByValue(String code) {
		return pool.get(code);
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public static Map<String, EnumBussinessParam> getPool() {
		return pool;
	}

	public static void setPool(Map<String, EnumBussinessParam> pool) {
		EnumBussinessParam.pool = pool;
	}
}
